﻿#region File Description
//-----------------------------------------------------------------------------
// Tile.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace projetSupinfoBFG
{

    enum ObstacleCollision
    {
        /// <summary>
        /// A passable obstacle is one which does not hinder ship motion at all.
        /// </summary>
        Passable = 0,

        /// <summary>
        /// An impassable obstacle is one which does not allow the ship to move through
        /// </summary>
        Impassable = 1,

        /// <summary>
        /// A slowing obstacle is an obstacle wich slow down the ship
        /// </summary>
        Slowing = 2,
    }

    /// <summary>
    /// Stores the appearance and collision behavior of a tile.
    /// </summary>
    struct Obstacle
    {
        public Texture2D Texture;
        public ObstacleCollision Collision;

        public const int Width = 30;
        public const int Height = 20;

        public static readonly Vector2 Size = new Vector2(Width, Height);

        /// <summary>
        /// Constructs a new tile.
        /// </summary>
        public Obstacle(Texture2D texture, ObstacleCollision collision)
        {
            Texture = texture;
            Collision = collision;
        }

        public int GetLength(int type)
        {
            if (type == 0)
                return Width;
            if (type == 1)
                return Height;

            return 1;

        }
    }
}
